#include<stdio.h>

int buyAndExchange(int price, int money, int emptyBottleBottle)
{
    int sodas = emptyBottleBottle / price;
    if(sodas > 0)
    {
        emptyBottleBottle %= price;
        return sodas + buyAndExchange(price, money, sodas + emptyBottleBottle);
    }

    return 0;
}

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);

    int num = buyAndExchange(n, m, m);

    printf("%d\n", num);

    return 0;
}
